/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Server.lastproject;



import Server.SQL.CommandManage;



/**
 *
 * @author CANG
 */

public class LastProject {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
    {
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (Exception  ex)
        {
        }
        //</editor-fold>
        //ConnectionForm connection = new ConnectionForm();
        //ServerForm server = new ServerForm();
        //ClientForm client = new ClientForm();
        //CommandManage cmManage = new CommandManage(""); 
        
        //CommandManage commandManage = new CommandManage("Insert into Hoc_Sinh(HO_TEN, LOP) values(Nguyen Van troi, 12B5)");
        //commandManage.Analysis_InsertCommand("into Hoc_Sinh(HO_TEN, LOP) values('Nguyen Van troi', '12B5')");
        
        /*Analyzer ana = new Analyzer();
        String cmd = "SELECT34 * FROM MENU";
        CommandType type = ana.AnalysisType(cmd);*/
        
        //ServerForm server = new ServerForm();


        //ServerForm2 server = new ServerForm2();
        //InsertCommand insertCommand = new InsertCommand("insert into LOP select MA_HOC_SINH, HO_TEN from HOC_SINH");
        //.analysic("into LOP select MA_HOC_SINH mhs, HO_TEN ht from HOC_SINH hs");

        //XMLManage manage = new XMLManage();
        //manage.deleteColumn("HOC_SINH", "HO_TEN");
        //manage.saveToFile();
        //XMLManage ma = new XMLManage();
        //Vector<MyDataType.MyRowData> ls =  ma.getAllRowData("LOP");//getAllRowDataWithSingleCondition("LOP", "MA_LOP='K09CTT1'");
        
        //Vector<Element> table1 = new Vector<Element>();
        //MyDataDynamic table2 = new MyDataDynamic();
        //MyDataDynamic table3 = new MyDataDynamic();
        //table2 = ma.getDataDynamicWithSingleCondition("LOP", "MA_LOP>123");
        //table2 = ma.getDataDynamicWithSingleCondition("LOP", "TEN_LOP='CTT2'");
        //table3 = ma.mergeDataDynamicOR(table1, table2);
        /*
        Vector<Attribute_Value> lstValue = new Vector<Attribute_Value>();
        Attribute_Value va1 = new Attribute_Value();
        va1.NameAttribute = "MA_LOP";
        va1.Value = "123";
        va1.Type = "string";
        lstValue.add(va1);
        va1 = new Attribute_Value();
        va1.NameAttribute = "TEN";
        va1.Value = "TEN";
        lstValue.add(va1);
        ma.insertRow("LOP" , lstValue);
        ma.saveToFile();*/
        
        //UpdateCommand up = new UpdateCommand("");
        //up.Analysis("UPDATE LOP SET MA_LOP='Nissestien', TEN_LOP='123' WHERE TEN_LOP NOT IN ('100', '200')");
        //up.Execute();
        
        //DeleteCommand de = new DeleteCommand("");
        //de.Analysis("DELETE FROM LOP WHERE MA_LOP='CTT1' AND TEN_LOP='0912035' OR TEN_LOP='0912389'");
        //de.Execute();
        //SelectCommand se = new SelectCommand("");
        //se.Analysis("SELECT * FROM LOP WHERE MA_LOP='CTT1' AND TEN_LOP='0912035'");
        //InsertCommand in  = new InsertCommand("");
        //in.analysic("into LOP values('1', 'dsd', 'ádf')");
        
        //MyDataDynamic data = new MyDataDynamic();
        //SelectCommand se = new SelectCommand("");
        //data = se.Analysic_SelectCommand("MA_LOP from LOP where MA_LOP = 'K09CTT1'");
        //StringHelper he = new StringHelper();
        //String s = he.ParseNOTIN2AND("MA_LOP NOT IN ( A,B,C )");
        
        CommandManage ma = new CommandManage("SELect * from LOP WHERE MA IN ( SELECT * FROM HOCSINH )");
        ma.AnalysicQueryLevel2();
    }
}
